package cn.hchaojie.spring.day01;

import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import cn.hchaojie.spring.day01.beans.CategoryBean;

public class Demo1ProperyInject {
	ApplicationContext context;
	@Before
	public void init() {
		context = new ClassPathXmlApplicationContext("context.xml");
	}

	/**
	 * 构造器注入属性
	 */
	@Test
	public void testConstructorInject() {
		CategoryBean bean = context.getBean(CategoryBean.class);
		System.out.println(bean);
	}
}
